package br.com.dufs.mvc.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fscoreunipe.app.infra.annotations.Create_AT;

@Create_AT
@Entity
@Table(name = "AGUA_ESTRADA_DOIS")
public class AguaEstradaDois implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	@Column
	private String tipo;
	@Column
	private String descricao;
	@Column
	private String outra;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "id_aguaEstrada")
	private AguaEstrada aguaEstrada;

	public AguaEstradaDois() {
		super();
	}

	public AguaEstradaDois(int id) {
		super();
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getTipo() {
		return tipo;
	}

	public void setTipo(String tipo) {
		this.tipo = tipo;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public String getOutra() {
		return outra;
	}

	public void setOutra(String outra) {
		this.outra = outra;
	}

	public AguaEstrada getAguaEstrada() {
		return aguaEstrada;
	}

	public void setAguaEstrada(AguaEstrada aguaEstrada) {
		this.aguaEstrada = aguaEstrada;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AguaEstradaDois other = (AguaEstradaDois) obj;
		if (id != other.id)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "AguaEstradaDois [id=" + id + "]";
	}

}
